import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AgentMrRefundApplyVO, AgentMrRefundApplyForm, AgentMrRefundApplyQuery } from '@/api/business/agentMrRefundApply/types';

/**
 * 查询医代退款申请列表
 * @param query
 * @returns {*}
 */

export const listAgentMrRefundApply = (query?: AgentMrRefundApplyQuery): AxiosPromise<AgentMrRefundApplyVO[]> => {
  return request({
    url: '/business/agentMrRefundApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询医代退款申请详细
 * @param id
 */
export const getAgentMrRefundApply = (id: string | number): AxiosPromise<AgentMrRefundApplyVO> => {
  return request({
    url: '/business/agentMrRefundApply/' + id,
    method: 'get'
  });
};

/**
 * 新增医代退款申请
 * @param data
 */
export const addAgentMrRefundApply = (data: AgentMrRefundApplyForm) => {
  return request({
    url: '/business/agentMrRefundApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改医代退款申请
 * @param data
 */
export const updateAgentMrRefundApply = (data: AgentMrRefundApplyForm) => {
  return request({
    url: '/business/agentMrRefundApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除医代退款申请
 * @param id
 */
export const delAgentMrRefundApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/agentMrRefundApply/' + id,
    method: 'delete'
  });
};
